<template>
	<view>
		<uni-row>
			<uni-col :span="24">
				<text class="text-red-600 text-30 flex items-center justify-center"> {{ $lang('错误信息') }}</text>
				<text class="m-5 break-all text-18 flex items-center justify-center">{{errorMsg}}</text>
			</uni-col>
			<uni-col :span="24" class="flex items-center justify-center">
				<image :src="errGif" />
			</uni-col>
			<uni-col :span="24">
				<button type="primary" class="m-10 rounded-[90px] h-[40px] flex items-center justify-center"
					@click="backTo">{{$lang('返回')}}</button>
			</uni-col>
		</uni-row>
	</view>
</template>

<script setup>
	import errImage from '@/static/images/error/401.gif'
	const props = defineProps({
		error: {
			type: String,
			default: ''
		}
	})
	const errorMsg = computed(() => decodeURIComponent(props.error))
	const errGif = ref(errImage + '?' + +new Date())

	function backTo() {
		uni.navigateBack();
	}
</script>

<style lang="scss">
	page {
		background-color: #ffffff;
	}
</style>